using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class MarketingChannelMap : EntityTypeConfiguration<MarketingChannel>
    {
        public MarketingChannelMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.SalesCountryCode)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.SchoolCode)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("MarketingChannel");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.MktChannel_id).HasColumnName("MktChannel_id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.MktChannelCode_Id).HasColumnName("MktChannelCode_Id");
            this.Property(t => t.SalesCountryCode).HasColumnName("SalesCountryCode");
            this.Property(t => t.SchoolCode).HasColumnName("SchoolCode");
            this.Property(t => t.IsEnabled).HasColumnName("IsEnabled");
            this.Property(t => t.IsCentral).HasColumnName("IsCentral");
            this.Property(t => t.IsLocal).HasColumnName("IsLocal");
            this.Property(t => t.ValidFromDate).HasColumnName("ValidFromDate");
            this.Property(t => t.ValidToDate).HasColumnName("ValidToDate");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.InsertBy_id).HasColumnName("InsertBy_id");
            this.Property(t => t.SaveDate).HasColumnName("SaveDate");
            this.Property(t => t.SaveBy_id).HasColumnName("SaveBy_id");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
        }
    }
}
